package com.buer.storage.business.service.impl;


import com.buer.storage.business.dao.AreaDao;
import com.buer.storage.business.domain.Area;
import com.buer.storage.business.dto.AreaDto;
import com.buer.storage.business.dto.DepartmentDto;
import com.buer.storage.business.service.AreaService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AreaServiceImpl implements AreaService {
    @Resource
    private AreaDao areaDao;

    @Override
    public int add(AreaDto areaDto) {
        return areaDao.add(areaDto);
    }

    @Override
    public int delete(int areaId) {
        return areaDao.delete(areaId);
    }

    @Override
    public int update(Area area) {
        return areaDao.update(area);
    }

    @Override
    public Area selectById(int areaId) {
        return areaDao.selectById(areaId);
    }

    @Override
    public List<DepartmentDto> findDepartment(int areaId) {
        List<DepartmentDto> department = areaDao.findDepartment(areaId);
        return department;
    }


}
